//
//  ViewController1.m
//  ProjectTest
//
//  Created by User on 2017/10/12.
//  Copyright © 2017年 User. All rights reserved.
//

#import "ViewController1.h"
#import "ViewController2.h"

@interface ViewController1 ()
@property (weak, nonatomic) IBOutlet UITextField *textField;

@end

@implementation ViewController1

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"first";
    self.view.backgroundColor = [UIColor whiteColor];
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
- (IBAction)pushAction:(id)sender {
    
}

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    if ([@"newPushSegue" isEqualToString:segue.identifier])
    {
        ViewController2 *vc2 = segue.destinationViewController;
        vc2.sendString = self.textField.text;
    }
}

- (IBAction)dataBlock:(UIStoryboardSegue *)segue
{
    if ([@"dataBlockSegue" isEqualToString:segue.identifier])
    {
        NSString *blockStr = ((ViewController2 *)segue.sourceViewController).sendString;
        self.textField.text = blockStr;
    }
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
